import request from "@/api/index"

export default {
  /**
   * @description: 添加设备策略 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  add(params) {
    const url = "/iot/equipmentStrategy/add"
    return request.post(url, {
      ...params
    })
  },
  /**
   * @description: 编辑设备策略 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  edit(params) {
    const url = "/iot/equipmentStrategy/edit"
    return request.post(url, {
      ...params
    })
  },
  /**
 * @description: 批量修改优先级 *代表必填
 * @param {Object} params *
 * @return {Object}
 */
  editBatch(params) {
    const url = "iot/equipmentStrategy/editBatch"
    return request.post(url, [...params])
  },
  /**
   * @description: 批量删除设备策略 *代表必填
   * @param {String/Number} id *
   * @return {Object}
   */
  delListById(params) {
    const url = "/iot/equipmentStrategy/delListById"
    return request.get(url, params)
  },
  /**
   * @description: 单个删除设备策略 *代表必填
   * @param {String/Number} id *
   * @return {Object}
   */
  delById(params) {
    const url = "/iot/equipmentStrategy/delById"
    return request.get(url, params)
  },
  /**
   * @description: 生成验证码接口 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  getVerificationCode(params) {
    const url = "/base/code/getVerificationCode"
    return request.get(url, {
      ...params
    })
  },
  /**
   * @description: 根据鱼塘Id查询控制项及最新数据 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  queryControlItemByFishPondId(params) {
    const url = "/iot/dataCollect/queryControlItemByFishPondId"
    return request.get(url, {
      ...params
    })
  },
  /**
   * @description: 设备远程控制 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  remoteControl(params) {
    const url = "/iot/iotPlatform/rtuControl/remoteControl"
    return request.post(url, {
      ...params
    })
  },
  /**
  * @description: 设备控制策略 *代表必填
  * @param {Object} params *
  * @return {Object}
  */
  rtuRunStrategy(params) {
    const url = "iot/iotPlatform/rtuRunStrategy/add"
    return request.post(url, {
      ...params
    })
  },

  /**
  * @description: 设备控制策略 *代表必填
  * @param {Object} params *
  * @return {Object}
  */
  clearAppStrategy(params) {
    const url = "iot/iotPlatform/rtuRunStrategy/clearAppStrategy"
    return request.post(url, {
      ...params
    })
  },
  /**
   * @description: 条件查询 *代表必填
   * @param {Object} params *
   * @return {Object}
   */
  queryByCondition(params) {
    const url = "/iot/equipmentStrategy/queryByCondition"
    return request.post(url, {
      ...params
    })
  },
  /**
   * @description: 分页查询设备策略 *代表必填
   * @param {Object} params *
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @return {Object}
   */
  queryPageByCondition(params) {
    const url = "/iot/equipmentStrategy/queryPageByCondition"
    return request.post(url, {
      ...params
    })
  },
}

